import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'
import user from './modules/user'

Vue.use(Vuex)

export default new Vuex.Store({
  modules: {
    user,
   
  },
   getters: {
      token: state => state.user.token,
      username: state => state.user.username,
      beacklist: state => state.user.beacklist,
    },
  plugins: [createPersistedState({
    storage: localStorage,
    key: "data"
  })] //会自动保存创建的状态。刷新还在
})